package com.chanyachting.emall.action.companyproduct;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.chanyachting.emall.domain.Match;
import com.chanyachting.emall.form.MatchForm;
import com.chanyachting.emall.service.MatchService;
import com.chanyachting.emall.serviceImpl.MatchServiceImpl;

public class EditMatchAction extends Action {
	
	
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		
		MatchForm maform=(MatchForm)form;
		
		Match ma= null;
		try {
			
			MatchService cpservice=new MatchServiceImpl();
			
			ma = cpservice.getOneMatchById(maform.getId().toString());
			
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		maform.setMatch(ma);
		
		return mapping.findForward("editMatch");
	}
	

}
